<template>
  <div class="sending">
    <button @click="test1">提交</button>
    <button @click="test2">提交</button>
    <button @click="test3">提交</button>
  </div>
</template>

<script>
import axios from "axios";

export default {
  name: "Send",
  methods: {
    test1() {
      axios
        .get("http://sph-h5-api.atguigu.cn/api/product/getBaseCategoryList")
        .then(
          (res) => {
            console.log("请求成功", res.data.data);
          },
          (err) => {
            console.log("请求失败", err.message);
          }
        );
    },
    test2() {
      axios
        .get("http://localhost:8080/api/hot-event/hot-board/?origin=toutiao_pc")
        .then(
          (res) => {
            console.log("请求成功", res.data.data);
          },
          (err) => {
            console.log("请求失败", err.message);
          }
        );
    },
    test3() {
      axios
        .get("http://localhost:8080/foo/widget?id=LocalNews&ajax=json")
        .then(
          (res) => {
            console.log("请求成功", res.data.data.LocalNews.data.rows.first);
          },
          (err) => {
            console.log("请求失败", err.message);
          }
        );
    },
  },
};
</script>

<style scoped>
.sending {
  background-image: linear-gradient(0deg, #30cfd0 0%, #330867 100%);
  padding: 20px;
  box-shadow: 0 0 10px saddlebrown;
  border-radius: 20px;
}
</style>